package com.yun.many.web;

import cn.hutool.core.util.StrUtil;
import com.yun.many.spec.utils.SpringContextUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.StringJoiner;

@Slf4j
@SpringBootApplication(scanBasePackages = {"com.yun.many"})
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        startDoneLog();
    }

    private static void startDoneLog() {
        String envList = String.join(StrUtil.COMMA, SpringContextUtils.getContext().getEnvironment().getActiveProfiles());
        StringJoiner sj = new StringJoiner("\n", "\n", "\n");
        sj.add("*******************************************************************************");
        sj.add("*");
        sj.add("*");
        sj.add("* 启动完成,当前环境:" + envList);
        sj.add("*");
        sj.add("*");
        sj.add("*******************************************************************************");
        log.info(sj.toString());
    }
}
